<?php
/**
 * <b>RUBIK IT Solution & Development ltd.</b>
 *
 * PROJECT		: Rubik Ultimate Framework
 * @version 	: 1.1
 * COPYRIGHT    : 2008
 * ------------------------------------------------------
 * 
 * Created on	:  Jun 26, 2008
 * 
 */

// no direct access
defined ( '_FW_EXEC' ) or die ( 'Restricted access' );
RCoreImporter::cls( "html.BasePagination" );

class Pagination extends BasePagination {
	
	/**	
	 * Render Pager
	 *
	 * @param Page current $index
	 * @return HTML to show pager
	 */
	function renderPager($index) {
		$output = '';
		if ($this->_totalPages > 1) {
			$this->setPagerText ();
			$output .= '<div align="center">';
			
			$output .= $this->getPagerFirst ( $index );
			$output .= $this->getPagerPrevious ( $index );
			$output .= $this->getPagerList ( $index );
			$output .= $this->getPagerNext ( $index );
			$output .= $this->getPagerLast ( $index );
			
			$output .= '</div>';
		}
		return $output;
	}
	
	/**
	 * Get Pager Number Link
	 *
	 * @param String $text
	 * @param Number - current page $index
	 * @return unknown
	 */
	function getPagerNumberLink($text, $index) {
		$link = $this->_link . '=' . $index;
		$output = '&nbsp;<a href="' . $link . '">' . $text . '</a>';
		return $output;
	}
	
	/**
	 * Get Pager Text Link
	 *
	 * @param String $text
	 * @param Number - current page $index
	 * @return unknown
	 */
	function getPagerTextLink($text, $index) {
		$link = $this->_link . '=' . $index;
		$output = '&nbsp;&nbsp;&nbsp;<a href="' . $link . '">' . $text . '</a>';
		return $output;
	}
	
	/**
	 * Get Active Page
	 *
	 * @param String $text
	 * @return unknown
	 */
	function getActivePage($text) {
		return '&nbsp;<strong>' . $text . '</strong>';
	}

}
?>